<?php

namespace App\Http\Api\Controllers;

use App\Exceptions\InvalidRequestException;

use App\Http\Api\Services\ManuService;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;


class ManuController extends Controller
{
    protected $manuService;

    public function __construct(ManuService $manuService)
    {
        $this->manuService = $manuService;
    }

    /*
     * 厂家采集 from管家婆
     * */
    public function store(Request $request)
    {
        $attributes = $request->input('data') ?? null;

        $result = $this->manuService->store($attributes);

        return res('采集完成',$result);
    }

    /*
     * 厂家列表
     */
    public function manuList(Request $request)
    {
        $attributes = $request->input('manu_name') ?? null;

        $result = $this->manuService->data($attributes);

        return $result;
    }


}
